CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

  LEFT          = 14
  RIGHT         = 15
  
obj



var



pub go | i

  outa[LEFT]~
  outa[RIGHT]~
  dira[LEFT]~~
  dira[RIGHT]~~
{
  dira~~
  repeat
    !outa
    waitcnt(cnt + clkfreq)

  repeat 12
    !outa[left..right]
}  

  repeat i from 0 to 1000 step 4
    pulsout(left, 1000 + i)
    pulsout(right, 1000 + i)
    pauseus(20_000)



pub pulsout(p, t)

  outa[p]~~                     'drive pin high
  pauseus(t)
  outa[p]~                      'drive pin low
    
pub pauseus(t)

  waitcnt(cnt + (clkfreq/1_000_000) * t)  